//
//  Timer.h
//  Bluetooth
//
//  Created by apple on 14/11/1.
//  Copyright (c) 2014年 com.yourname. All rights reserved.
//

#import "ios_lib.h"
#import <Foundation/Foundation.h>

typedef void* HWND;
typedef unsigned short UINT;
typedef unsigned long DWORD;

struct timer_attr{
    bool bUsed;
    app_timer_id_t timer_id;
    app_timer_mode_t mode;
    app_timer_timeout_handler_t timeout_handler;
    void * p_context;
};
@interface Timer : NSObject
@property (nonatomic, strong) NSTimer *paintingTimer;
-(void) timerProc:(HWND)hwnd
             uMsg:(UINT)uMsg
          idEvent:(UINT)idEvent
           dwTime:(DWORD)dwTime;
-(uint32_t)app_timer_start:(app_timer_id_t)timer_id
             timeout_ticks:(uint32_t)timeout_ticks
                 p_context:(void*)p_context;
-(uint32_t) app_timer_stop:(app_timer_id_t)timer_id;
-(uint32_t)app_timer_create:(app_timer_id_t * )p_timer_id
                       mode:(app_timer_mode_t)mode
            timeout_handler:(app_timer_timeout_handler_t)timeout_handler;
-(uint32_t)app_query_timer:(app_timer_id_t)timer_id;
@end
